package com.example.aircraftwar.codes.aircraft;

import android.content.Context;

import com.example.aircraftwar.codes.activity.GameActivity;
import com.example.aircraftwar.codes.application.ImageManager;
import com.example.aircraftwar.codes.bullet.BaseBullet;
import com.example.aircraftwar.codes.bullet.HeroBullet;
import com.example.aircraftwar.codes.strategy.HeroStraightShoot;
import com.example.aircraftwar.codes.strategy.ShootStrategy;

import java.util.LinkedList;
import java.util.List;

public class HeroAircraft extends AbstractAircraft {

    /**
     * 攻击方式
     */
    private int shootNum = 1;     //子弹一次发射数量
    private int power = 30;       //子弹伤害
    private int direction = -1;  //子弹射击方向 (向上发射：1，向下发射：-1)

    private volatile static HeroAircraft heroAircraft;
    /**
     * @param locationX 英雄机位置x坐标
     * @param locationY 英雄机位置y坐标
     * @param speedX    英雄机射出的子弹的基准速度（英雄机无特定速度）
     * @param speedY    英雄机射出的子弹的基准速度（英雄机无特定速度）
     * @param hp        初始生命值
     */

    private HeroAircraft(Context context, int locationX, int locationY, int speedX, int speedY, int hp, ShootStrategy shootStrategy) {
        super(context, locationX, locationY, speedX, speedY, hp, shootStrategy);
    }

    public static HeroAircraft getHeroAircraft(Context context){
        if(heroAircraft == null){
            synchronized (HeroAircraft.class){
                if(heroAircraft == null){
                    heroAircraft = new HeroAircraft(
                            context,
                            GameActivity.WINDOW_WIDTH / 2,
                            GameActivity.WINDOW_HEIGHT - ImageManager.HERO_IMAGE.getHeight() ,
                            0, 0, 100,
                            new HeroStraightShoot());
                }
            }
        }
        return heroAircraft;
    }

    @Override
    public void forward() {
        // 英雄机由鼠标控制，不通过forward函数移动
    }

}
